home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 March
/
PCWorld_2007-03_cd.bin
/
v cisle
/
pcwkillall
/
pcwKillEmAll.exe
/
Tools
/
pcwKillUninstall.hta
< prev
Wrap
Text File
|
2006-09-18
|
7KB
|
203 lines
<HTML>
<HEAD>
<TITLE>Skript PC WORLDu pro odstran∞nφ slo₧ek pro odinstalovßnφ zßplat</TITLE>
<HTA:APPLICATION ID="hta3"
APPLICATIONNAME="KillUninstall"
BORDER = "normal"
CAPTION = "yes"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "normal"
SCROLL = "no"
SCROLLFLAT = "no"
VERSION = "1.0"
INNERBORDER = "no"
SELECTION = "no"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "No"
CONTEXTMENU = "no"
BORDERSTYLE = "normal">
<STYLE type="text/css">
body { scrollbar-arrow-color: #000000;
font-family:Verdana;
font-style:normal;
font-size:12;
background-color:Buttonface}
.fading {font-size:14px;
background-color:#003159;
color:white;width:400;
filter:Alpha(style=1, opacity=90, startx=83, finishx=86)
</STYLE>
<SCRIPT LANGUAGE=vbscript>
'|--------------------------------------------------------------------------------------------------|'
Dim aSubKeys()
Dim aSubFolder()
Dim aCompRes()
Set myshell = CreateObject("Wscript.Shell")
Set MyFiles = CreateObject("Scripting.FileSystemObject")
Set c = MyShell.Environment("PROCESS")
windir = c("systemroot")
DeinstKey="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
LastKey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey"
const HKEY_LOCAL_MACHINE = &H80000002
'|--------------------------------------------------------------------------------------------------|'
Sub SubInitFenster
Redim aCompRes(3, 0)
GetKeyArray
GetFolderArray
z = 0
for x = 0 to Ubound(aSubFolder, 2)
for y = 0 to Ubound(aSubKeys, 2)
if not instr(1, aSubKeys(1, y), aSubFolder(0, x), vbTextCompare) = 0 and not aSubFolder(0, x) = "" then
Redim Preserve aCompRes(3, z)
aCompRes(0, z) = aSubKeys(0, y) 'PodklφΦ
aCompRes(1, z) = aSubFolder(0, x) 'Podslo₧ka
aCompRes(2, z) = aSubKeys(2, y) 'URL pomocn²m odkazem
aCompRes(3, z) = aSubFolder(1, x) 'Velikost slo₧ky
z = z+1
end if
next
next
if z=0 then
Liste = ""
FullSize = 0
FullNum = 0
else
For z = 0 to Ubound(aCompRes, 2)
LoadList = "<DIV ID=ColorSelR" & z & " Title=" & chr(34) & aCompRes(0, z) & Chr(34) & "><INPUT type=checkbox name=SelReg" & z & " Title=" & chr(34) & aCompRes(0, z) & chr(34) & " onClick=" & Chr(34) & "SubShowRes" & Chr(34) & "><a href=" & aCompRes(2, z) & " target=_blank>" & "Patch-ID: " & aCompRes(0, z) & "</a> --> velikost je asi " & Round(aCompRes(3, z)/1048576, 2) & " MB</DIV>"
Liste = Liste & LoadList
Fullsize = Fullsize + aCompRes(3, z)
next
Fullsize = Round(Fullsize/1048576, 2)
FullNum = z
end if
text = " 'Uninstall' slo₧ek nalezeno<BR> Celkovß velikost je asi <B>" & Fullsize & "</B> MB"
document.all.tableRegKey.innerHTML = Liste
document.all.tableSum.innerHTML = "<DIV ID=Counter Title=" & Ubound(aCompRes, 2) & "> " & Fullnum & text & "</DIV>"
window.resizeTo 417, 420
End Sub
'|--------------------------------------------------------------------------------------------------|'
Sub GetKeyArray()
on error resume next
Redim aSubKeys(2, 0)
Set wmi=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
sKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
wmi.EnumKey HKEY_LOCAL_MACHINE,sKeyPath,AllKeys
m = 0
For Each subkey In AllKeys
Redim Preserve aSubKeys(2, m)
wmi.GetStringValue HKEY_LOCAL_MACHINE,sKeyPath & "\" & subkey,"UninstallString",UninstallStr
HelpLink = MyShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & subkey & "\HelpLink")
aSubKeys(0, m) = subkey
aSubKeys(1, m) = UninstallStr
aSubKeys(2, m) = HelpLink
m = m+1
Next
End Sub
'|--------------------------------------------------------------------------------------------------|'
Sub GetFolderArray()
Redim aSubFolder(1, 0)
set SysFold = MyFiles.GetFolder(Windir)
set SysSubs=Sysfold.SubFolders
n=0
For each SysSub in SysSubs
SubName=SysSub.Name
If Left(SubName, 1) = "$" then
SubSize=SysSub.Size
Redim Preserve aSubFolder(1, n)
aSubFolder(0, n) = Subname
aSubFolder(1, n) = SubSize
n = n+1
end if
next
End Sub
'|--------------------------------------------------------------------------------------------------|'
Sub SubShowRes
on error resume next
m = 0
zahl = document.all.Item("Counter").Title
do
If document.all.Item("SelReg"& m).Checked Then
document.all.Item("SelReg" & m).style.backgroundColor="salmon"
document.all.Item("ColorSelR" & m).style.backgroundColor="salmon"
Else
document.all.Item("SelReg" & m).style.backgroundColor=""
document.all.Item("ColorSelR" & m).style.backgroundColor=""
End If
m = m+1
loop until zahl - m = -1
End Sub
'|--------------------------------------------------------------------------------------------------|'
Sub SubDelSel
on error resume next
z = 0
zahl = document.all.Item("Counter").Title
do
If document.all.Item("SelReg"& z).Checked Then
ret = MyFiles.Deletefolder(Windir & "\" & aCompRes(1, z), True)
ret = MyShell.Regdelete(DeinstKey & aCompRes(0, z) & "\")
LogFile= Windir & "\" & aCompRes(0, z) & ".log"
If MyFiles.FileExists(LogFile) Then MyFiles.DeleteFile LogFile,true
End If
z = z+1
loop until zahl - z = -1
SubInitFenster
End Sub
'|--------------------------------------------------------------------------------------------------|'
Sub SubDelAll
z = 0
zahl = document.all.Item("Counter").Title
do
document.all.Item("SelReg"& z).Checked = True
z = z+1
loop until zahl - z = -1
SubShowRes
ret = Msgbox("Majφ se skuteΦn∞ u vÜech nalezen²ch zßplat odebrat vÜechny slo₧ky pro odinstalovßnφ zßplat a vÜechny zßznamy v registru, kterΘ k nim pat°φ?", vbYesNo+vbExclamation, "Odstranit vÜechny")
if ret = vbNo then
z = 0
do
document.all.Item("SelReg"& z).Checked = False
z = z+1
loop until zahl - z = -1
SubShowRes
else
SubDelSel
end if
SubInitFenster
end Sub
'|--------------------------------------------------------------------------------------------------|'
Sub SubQuit
Set myshell = Nothing
Set myfiles = Nothing
Window.Close
End Sub
'|--------------------------------------------------------------------------------------------------|'
</SCRIPT>
</HEAD>
<BODY onload="SubInitFenster" scroll="no">
<DIV ID=tableRegKey style="position:relative; top:0px; left:0px; width:390px; height:270px; overflow-y:auto"></DIV>
<HR style=" & Chr(34) & "height:5px; color:black" & Chr(34) &">
<DIV ID=tableSum></DIV>
<HR style=" & Chr(34) & "height:5px; color:black" & Chr(34) &">
<INPUT Type=button value="Odstranit oznaΦenΘ" name=killsel size=102 onClick="SubDelSel">
<INPUT Type=button value="Odstranit vÜechny" name=killall size=102 onClick="SubDelAll">
<INPUT Type=button value="Konec" name=htaquit size=52 onClick="SubQuit"></BR>
</BODY>
</HTML>